package com.zyy;

import java.math.BigInteger;
import java.util.*;

public class Scanner02 {
   public static void main(String[] args) {
       Scanner in = new Scanner(System.in);
       // 注意 hasNext 和 hasNextLine 的区别
       int count = in.nextInt();
       // 消耗掉 nextInt() 后遗留的换行符
       in.nextLine();
       Set<String> sets = new HashSet<>();
       String[] arr = new String[count];
       String str ;
       for (int i = 0; i < count; i++){
           str= in.nextLine();
           char[] chars= str.toCharArray();
           Arrays.sort(chars);
           str= new String(chars);
           sets.add(str);
       }
       System.out.println(sets.size());
   }
}

